app.controller('platformStorageCtrl', ['$rootScope', '$scope', 'httpLoad', '$modal', '$stateParams', '$state', function ($rootScope, $scope, httpLoad, $modal, $stateParams, $state) {
    $scope.itemsByPage = 10;//定义每页的条数
    $scope.data = {
        serverListData:''
    };
    //加载服务器列表
    $scope.getList = function(){
        httpLoad.loadData({
            url:'/res/vendor/store',
            method:'POST',
            noParam: true,
            success:function(data){
                if(data.success){
                    $scope.data.serverListData = data.data;
                    $scope.total = data.data.length;
                    $scope.data.serverListData.forEach(function(item){
                        if(item.status=='green') item.status1 = '正常';
                        if(item.status=='red') item.status1 = '异常';
                        if(item.status=='yellow') item.status1 = '告警';
                        if(item.status=='gray') item.status1 = '不可用';
                    });
                }
            }
        });
    };
    $scope.getList();
}]);
app.filter('myStrictFilter', function($filter){
    return function(input, predicate){
        return $filter('filter')(input, predicate, true);
    }
});
app.filter('unique', function() {
    return function (arr, field) {
        var o = {}, i, l = arr.length, r = [];
        for(i=0; i<l;i+=1) {
            o[arr[i][field]] = arr[i];
        }
        for(i in o) {
            r.push(o[i]);
        }
        return r;
    };
  })